package com.bytedance.improvingroad.activity

import android.util.Log
import android.view.View
import android.widget.Button
import android.widget.FrameLayout
import android.widget.TextView
import com.bytedance.improvingroad.R
import com.bytedance.improvingroad.widget.ClipAbleTextView
import com.bytedance.improvingroad.widget.GradualShowTextView

/**
 * Created by chenxiong
 * date 11/11/21
 */
class TestActivity: BaseActivity() {
//    private lateinit var childView: View
//    private lateinit var container: FrameLayout
    private lateinit var clipAbleTextView: ClipAbleTextView
    override fun init() {
//        childView = findViewById(R.id.child)
//        container = findViewById(R.id.container)
//
//        childView.setOnClickListener {
//            Log.e("cx","孩子被点击了")
//        }
//        container.setOnClickListener {
//            Log.e("cx","父亲被点击了")
//        }
//        clipAbleTextView = findViewById(R.id.clip)
//        clipAbleTextView.startGradualDraw()
        val gradualShowTextView = findViewById<GradualShowTextView>(R.id.gradual)
        findViewById<Button>(R.id.startbtn).setOnClickListener {
            gradualShowTextView.startAnim()
        }
        findViewById<Button>(R.id.continuebtn).setOnClickListener {
            gradualShowTextView.continueAnim()
        }
        findViewById<Button>(R.id.resetbtn).setOnClickListener {
            gradualShowTextView.resetAnim()
        }
        findViewById<Button>(R.id.stopbtn).setOnClickListener {
            gradualShowTextView.stopAnim()
        }

    }

    override fun getLayoutId() = R.layout.activity_test
}